﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;


namespace pGrid
{
	[Serializable]
	class Stations_list
	{
		private IList<PowerStation> stList = new List<PowerStation>();

		public IList<PowerStation> station_list
		{
			get
			{
				return stList;
			}
			set
			{
				stList = value;
			}
		}
		public PowerStation GetStation(int pos)
		{
			return this.stList[pos];
		}
		public void Add(PowerStation item)
		{
			this.stList.Add(item);
		}
		public void RandomInsert(PowerStation item)
		{
			int size = stList.Count;
			System.Random getRand = new Random();
			int pos = getRand.Next(0, size);
			this.stList.Insert(pos, item);
		}
		public void RandomDelete()
		{
			int size = stList.Count;
			System.Random getRand = new Random();
			int pos = getRand.Next(0, size);
			this.stList.RemoveAt(pos);
		}
		public void Insert(int position, PowerStation item)
		{
			this.stList.Insert(position, item);
		}
		public int Size()
		{
			return this.stList.Count();
		}
		public void Sort()
		{
			//stList.OrderByDescending(Func<PowerStation,TKey> keySelector);
			Stations_list list = new Stations_list();
			/*
			PowerStation prevSt = this.stList[0];
			for(int i = 1 ; i < this.stList.Count; i++)
			{
				PowerStation curSt = this.stList[i];
				if (prevSt.Number < curSt.Number)
					
			}
			 */
		}
	}
}
